import { createApp } from "vue";
// import Antd from "ant-design-vue";
// import "ant-design-vue/dist/reset.css";
import ElementPlus from "element-plus"; //全局引入
import "element-plus/dist/index.css";
import "./style.scss";
import App from "./App.vue";
import mitt from "mitt";
import router from "./router/index.js";
import { createPinia } from "pinia";
import i18n from "./locales/index.js";

import "./assets/iconfont.js";
import gloabComponent from "./components/index.js";
// import SvgIcon from "./components/SvgIcon.vue";
// Vue.component("svg-icon", SvgIcon);

import * as ElementPlusIconsVue from "@element-plus/icons-vue";

import { directives } from "./directive";

// createApp(App).mount('#app')
const app = createApp(App);
const pinia = createPinia();

// 注册指令
Object.keys(directives).forEach(key => {
	app.directive(key, directives[key]);
});

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
	app.component(key, component);
}

app.config.globalProperties.emitter = mitt();
// app.use(Antd);
app.use(ElementPlus);
app.use(pinia);
app.use(router);
app.use(gloabComponent);
app.use(i18n);
app.mount("#app");
